package ua.tach.shortl;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.TextureRegion;

public class TextureLoader {
	final static int SP_DIGITW = 17;
	final static int SP_DIGITH = 28;
	private final static int SP_BASEX = 800;
	private final static int SP_BASEY = 432;

	public static TextureRegion background;
	public static TextureRegion logo1;
	public static TextureRegion logo2;
	/** texture for banner place **/
	public static TextureRegion bannerPlTexture;
	/** texture for side rail menu **/
	public static TextureRegion menuTexture;
	public static TextureRegion[] entersTexture = new TextureRegion[2];
	/** texture for game menu parts **/
	public static TextureRegion[] gameMenuTexture = new TextureRegion[3]; // top, middle and bottom
	

	public TextureLoader () {
		Texture t = new Texture(Gdx.files.internal("data/title1.png"));
		background = new TextureRegion(t,0,0,800,480);
		logo1 = new TextureRegion(t,0,480,502,72);
		logo2 = new TextureRegion(t,0,552,502,72);
		bannerPlTexture = new TextureRegion(t,0,624,800,48);
		entersTexture[0] = new TextureRegion(t,880,0,20,28);
		entersTexture[1] = new TextureRegion(t,900,0,20,28);
		menuTexture = new TextureRegion(t,800,0,80,432);
		RenderCounter.DigitTexture = split(t);
		gameMenuTexture[0] = new TextureRegion(t,0,672,320,32);
		gameMenuTexture[1] = new TextureRegion(t,0,704,320,32);
		gameMenuTexture[2] = new TextureRegion(t,0,736,320,38);
	}
	
	private static TextureRegion[] split (Texture t) {
		int Slices = 10;
		TextureRegion[] res = new TextureRegion[Slices];
		for (int x = 0; x < Slices; x++) {
				res[x] = new TextureRegion(t, SP_BASEX + x * SP_DIGITW, SP_BASEY, SP_DIGITW, SP_DIGITH);
		}
		return res;
	}

}
